package com.chen.pojo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

@Schema(description = "设置的分页查询的一些参数")
@Data
public class PageParam {
    //设置分页操作时候的默认值
    public static final Integer PAGE_DEFAULT_SIZE = 10;
    public static final Integer PAGE_DEFAULT_NO = 1;

    /**
     * 分页页数
     */
    @Schema(description = "分页页数", requiredMode =  Schema.RequiredMode.REQUIRED,example = "10")
    @NotNull
    @Min(1)
    @Max(100)
    private Integer pageSize=PAGE_DEFAULT_SIZE;


    /**
     * 分页页码
     */
    @Schema(description = "分页页码", requiredMode =  Schema.RequiredMode.REQUIRED,example = "1")
    @NotNull
    @Min(1)
    private Integer pageNo=PAGE_DEFAULT_NO;
}
